<template>
  <view>
         <view class="content">
           <view class="content_top">
             
             <text>{{hotel}}</text>
             <text>用户：{{userName}}</text>
           </view>
         <!--   <view class="icon iconfont icon-dingdan1">
                    &#xe6a3;
            </view> -->
               <button class="content_button" @click="login">退出登录</button>
              
         </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        userName:"",
        hotel:''
      }
    },
    methods: {
      login(){
         uni.clearStorageSync()
uni.reLaunch({
	 url:'/pages/login/login/login'
	
})
        
      },
    },
    onReady () {
      this.userName = this.$store.state.name
      let name =  uni.getStorageSync('userInfo' )
      // let pws =   uni.getStorageSync('password' )
	  console.log( name )
         if ( name  ) { this.userName == name  }

      this.$request.post('user/user').then(res=>{
        console.log( res.data.hotelName )
        
        this.$store.commit('setHotelId', res.data.hotelId)
		if( res.data.hotelName ==null || res.data.hotelName ==undefined || res.data.hotelName == '' ){
			 return 
		}
       this.hotel = res.data.hotelName
        console.log( res )
      }) 
   
     
    }	
  }
</script>
<style scoped>
.content {
      width: 100vw;
      font-size: 30rpx;
      height: 120rpx;
      background-color: #8CC7B5;
      display: flex;
      flex-direction: row;
      justify-content: space-around;
      align-items: center;
}
.content_top text {
    display: flex;
    flex-direction: column;
    
    padding: 0 10rpx;
    margin-right: 120rpx;
}
.content_button {
     font-size: 40rpx;
     width: 250rpx;
     color: black;
    /* margin-left: 70rpx; */
    color: #7A7E83;
    background-color: #fff;
	line-height: 1.7;
}
</style>
